<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="htmlPage" /></title>
</head>
<body>
    <h1><fmt:message key="htmlPage" /></h1>
    <c:url var="updateUrl" value="/domain/htmlPage/update.action"/>
    <form:form action="${updateUrl}" id="htmlPageForm" modelAttribute="htmlPageForm" >
        <form:errors cssClass="error"/>
        <table>
            <form:hidden path="htmlPage.inode"/>
            <tbody>
                <tr>
                    <th><fmt:message key="htmlPage_title" /></th>
                    <td>
                        <form:input path="htmlPage.title"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.title",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.title"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_friendlyName" /></th>
                    <td>
                        <form:input path="htmlPage.friendlyName"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.friendlyName",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.friendlyName"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_showOnMenu" /></th>
                    <td>
                        <form:checkbox id="htmlPage.showOnMenu" path="htmlPage.showOnMenu"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.showOnMenu",
                                widgetType : "dijit.form.CheckBox",
                                widgetAttrs : {
                                    checked: ${htmlPageForm.htmlPage.showOnMenu != null ? htmlPageForm.htmlPage.showOnMenu : false}
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.showOnMenu"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_sortOrder" /></th>
                    <td>
                        <form:input path="htmlPage.sortOrder"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.sortOrder",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                    ,regExp : "[-+]?[0-9]+(\.[0-9]+)?"
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.sortOrder"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_startDate" /></th>
                    <td>
                        <form:input path="htmlPage.startDate"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.startDate",
                                widgetType : "dijit.form.DateTextBox",
                                widgetAttrs : {
                                    required : false,
									datePattern: 'yyyy-MM-dd'
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.startDate"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_endDate" /></th>
                    <td>
                        <form:input path="htmlPage.endDate"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.endDate",
                                widgetType : "dijit.form.DateTextBox",
                                widgetAttrs : {
                                    required : false,
									datePattern: 'yyyy-MM-dd'
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.endDate"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_pageUrl" /></th>
                    <td>
                        <form:input path="htmlPage.pageUrl" readonly="true" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.pageUrl",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.pageUrl"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_httpsRequired" /></th>
                    <td>
                        <form:checkbox id="htmlPage.httpsRequired" path="htmlPage.httpsRequired"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.httpsRequired",
                                widgetType : "dijit.form.CheckBox",
                                widgetAttrs : {
                                    checked: ${htmlPageForm.htmlPage.httpsRequired != null ? htmlPageForm.htmlPage.httpsRequired : false}
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.httpsRequired"/>
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_redirect" /></th>
                    <td>
                        <form:input path="htmlPage.redirect"/>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.redirect",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.redirect"/>
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <div class="buttons">
                            <button id="updateButton" type="submit"><fmt:message key="label.form.submit"/></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'updateButton',
                                    event:'onclick'
                                }));
                            </script>
                            <c:url var="showUrl" value="/domain/htmlPage/show.action">
                                <c:param name="htmlPage.inode" value="${htmlPageForm.htmlPage.inode}"/>
                            </c:url>
                            <a href="${showUrl}"><span><fmt:message key="label.link.show"/></span></a>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
</body>
